package com.jh.channel.pojo.fastsilver;


import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.Objects;

public class FastSilverOrderView implements Serializable {

    private static final long serialVersionUID = 1L;


    //订单类型
    private String orderType;

    //用户id
    private long userId;

    //订单状态
    private String orderStatus;

    //金额
    private BigDecimal money;

    //订单号
    private String orderNo;

    //商户id
    private String merchantId;

    //商户名称
    private String merchantName;

    //分店名称
    private String device;

    //商品信息
    private String goodsMsg;

    //快银订单号
    private String outTradeNo;

    //支付成功时间
    private Date timeEnd;

    //通道流⽔号
    private String transactiOnId;

    //应付金额
    private BigDecimal payable;

    //优惠金额
    private BigDecimal activity;

    //⼿续费金额
    private BigDecimal commission;

    //退款状态
    private RefundStatus refundStatus ;

    //退款金额
    private BigDecimal refundMoney;

    //退款时间
    private Date refundTime;

    //退款完成时间
    private Date refundEndTime;

    //退款详情
    private String refundInfo;

    //快银退款单号
    private String refundOrderId;

    //商户退款 流⽔水号
    private String shopRefundOrderId;

    private String sign;

    //回调地址
    private String redirectUrl;

    //回调次数
    private String redirectNumber;

    private String resultCode;

    private String resultMsg;

    private String startDate;

    private String endDate;

    private String minAmount;

    private String maxAmount;

    private Date createTime;

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getStartDate() {
        return startDate;
    }

    public void setStartDate(String startDate) {
        this.startDate = startDate;
    }

    public String getEndDate() {
        return endDate;
    }

    public void setEndDate(String endDate) {
        this.endDate = endDate;
    }

    public String getMinAmount() {
        return minAmount;
    }

    public void setMinAmount(String minAmount) {
        this.minAmount = minAmount;
    }

    public String getMaxAmount() {
        return maxAmount;
    }

    public void setMaxAmount(String maxAmount) {
        this.maxAmount = maxAmount;
    }

    public String getMerchantName() {
        return merchantName;
    }

    public void setMerchantName(String merchantName) {
        this.merchantName = merchantName;
    }

    @Override
    public String toString() {
        return "FastSilverOrderView{" +
                "orderType='" + orderType + '\'' +
                ", userId=" + userId +
                ", orderStatus='" + orderStatus + '\'' +
                ", money=" + money +
                ", orderNo='" + orderNo + '\'' +
                ", merchantId='" + merchantId + '\'' +
                ", device='" + device + '\'' +
                ", goodsMsg='" + goodsMsg + '\'' +
                ", outTradeNo='" + outTradeNo + '\'' +
                ", timeEnd=" + timeEnd +
                ", transactiOnId='" + transactiOnId + '\'' +
                ", payable=" + payable +
                ", activity=" + activity +
                ", commission=" + commission +
                ", refundStatus=" + refundStatus +
                ", refundMoney=" + refundMoney +
                ", refundTime=" + refundTime +
                ", refundEndTime=" + refundEndTime +
                ", refundInfo='" + refundInfo + '\'' +
                ", refundOrderId='" + refundOrderId + '\'' +
                ", shopRefundOrderId='" + shopRefundOrderId + '\'' +
                ", sign='" + sign + '\'' +
                ", redirectUrl='" + redirectUrl + '\'' +
                ", redirectNumber='" + redirectNumber + '\'' +
                ", resultCode='" + resultCode + '\'' +
                ", resultMsg='" + resultMsg + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        FastSilverOrderView that = (FastSilverOrderView) o;
        return userId == that.userId &&
                Objects.equals(orderType, that.orderType) &&
                Objects.equals(orderStatus, that.orderStatus) &&
                Objects.equals(money, that.money) &&
                Objects.equals(orderNo, that.orderNo) &&
                Objects.equals(merchantId, that.merchantId) &&
                Objects.equals(device, that.device) &&
                Objects.equals(goodsMsg, that.goodsMsg) &&
                Objects.equals(outTradeNo, that.outTradeNo) &&
                Objects.equals(timeEnd, that.timeEnd) &&
                Objects.equals(transactiOnId, that.transactiOnId) &&
                Objects.equals(payable, that.payable) &&
                Objects.equals(activity, that.activity) &&
                Objects.equals(commission, that.commission) &&
                refundStatus == that.refundStatus &&
                Objects.equals(refundMoney, that.refundMoney) &&
                Objects.equals(refundTime, that.refundTime) &&
                Objects.equals(refundEndTime, that.refundEndTime) &&
                Objects.equals(refundInfo, that.refundInfo) &&
                Objects.equals(refundOrderId, that.refundOrderId) &&
                Objects.equals(shopRefundOrderId, that.shopRefundOrderId) &&
                Objects.equals(sign, that.sign) &&
                Objects.equals(redirectUrl, that.redirectUrl) &&
                Objects.equals(redirectNumber, that.redirectNumber) &&
                Objects.equals(resultCode, that.resultCode) &&
                Objects.equals(resultMsg, that.resultMsg);
    }

    @Override
    public int hashCode() {
        return Objects.hash(orderType, userId, orderStatus, money, orderNo, merchantId, device, goodsMsg, outTradeNo, timeEnd, transactiOnId, payable, activity, commission, refundStatus, refundMoney, refundTime, refundEndTime, refundInfo, refundOrderId, shopRefundOrderId, sign, redirectUrl, redirectNumber, resultCode, resultMsg);
    }

    public String getOrderType() {
        return orderType;
    }

    public void setOrderType(String orderType) {
        this.orderType = orderType;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public String getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(String orderStatus) {
        this.orderStatus = orderStatus;
    }

    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(String merchantId) {
        this.merchantId = merchantId;
    }

    public String getDevice() {
        return device;
    }

    public void setDevice(String device) {
        this.device = device;
    }

    public String getGoodsMsg() {
        return goodsMsg;
    }

    public void setGoodsMsg(String goodsMsg) {
        this.goodsMsg = goodsMsg;
    }

    public String getOutTradeNo() {
        return outTradeNo;
    }

    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo;
    }

    public Date getTimeEnd() {
        return timeEnd;
    }

    public void setTimeEnd(Date timeEnd) {
        this.timeEnd = timeEnd;
    }

    public void setRefundTime(Date refundTime) {
        this.refundTime = refundTime;
    }

    public void setRefundEndTime(Date refundEndTime) {
        this.refundEndTime = refundEndTime;
    }

    public String getTransactiOnId() {
        return transactiOnId;
    }

    public void setTransactiOnId(String transactiOnId) {
        this.transactiOnId = transactiOnId;
    }

    public BigDecimal getPayable() {
        return payable;
    }

    public void setPayable(BigDecimal payable) {
        this.payable = payable;
    }

    public BigDecimal getActivity() {
        return activity;
    }

    public void setActivity(BigDecimal activity) {
        this.activity = activity;
    }

    public BigDecimal getCommission() {
        return commission;
    }

    public void setCommission(BigDecimal commission) {
        this.commission = commission;
    }

    public RefundStatus getRefundStatus() {
        return refundStatus;
    }

    public void setRefundStatus(RefundStatus refundStatus) {
        this.refundStatus = refundStatus;
    }

    public BigDecimal getRefundMoney() {
        return refundMoney;
    }

    public void setRefundMoney(BigDecimal refundMoney) {
        this.refundMoney = refundMoney;
    }
    public String getRefundInfo() {
        return refundInfo;
    }

    public void setRefundInfo(String refundInfo) {
        this.refundInfo = refundInfo;
    }

    public String getRefundOrderId() {
        return refundOrderId;
    }

    public void setRefundOrderId(String refundOrderId) {
        this.refundOrderId = refundOrderId;
    }

    public String getShopRefundOrderId() {
        return shopRefundOrderId;
    }

    public void setShopRefundOrderId(String shopRefundOrderId) {
        this.shopRefundOrderId = shopRefundOrderId;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public String getRedirectUrl() {
        return redirectUrl;
    }

    public void setRedirectUrl(String redirectUrl) {
        this.redirectUrl = redirectUrl;
    }

    public String getRedirectNumber() {
        return redirectNumber;
    }

    public void setRedirectNumber(String redirectNumber) {
        this.redirectNumber = redirectNumber;
    }

    public String getResultCode() {
        return resultCode;
    }

    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }

    public String getResultMsg() {
        return resultMsg;
    }

    public void setResultMsg(String resultMsg) {
        this.resultMsg = resultMsg;
    }

    public Date getRefundTime() {
        return refundTime;
    }

    public Date getRefundEndTime() {
        return refundEndTime;
    }

    public FastSilverOrder transform() {
        FastSilverOrder order = new FastSilverOrder();
        order.setUserId(getUserId());
        order.setActivity(getActivity());
        order.setCommission(getCommission());
        order.setDevice(getDevice());
        order.setGoodsMsg(getGoodsMsg());
        order.setMoney(getMoney());
        order.setOrderNo(getOrderNo());
        order.setOrderStatus(OrderStatus.of(getOrderStatus()));
        order.setOrderType(OrderType.of(getOrderType()));
        order.setOutTradeNo(getOutTradeNo());
        order.setPayable(getPayable());
        order.setRefundEndTime(getRefundEndTime());
        order.setRefundInfo(getRefundInfo());
        order.setRefundMoney(getRefundMoney());
        order.setRefundOrderNo(getOrderNo());
        order.setRefundStatus(getRefundStatus());
        order.setRefundTime(getRefundTime());
        order.setShopRefundOrderNo(getShopRefundOrderId());
        order.setTransactiNo(getTransactiOnId());
        order.setUpdateTime(getTimeEnd());
        order.setMerchantId(getMerchantId());
        order.setMerchantName(getMerchantName());
        order.setCreateTime(getCreateTime());
        return order;
    }



}
